package com.guicent.geekai.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * GeekAI 响应 VO
 */
@Data
@ApiModel(description = "GeekAI 响应 VO")
public class GeekAiResponseVO {

    @ApiModelProperty(value = "ID")
    private String id;

    @ApiModelProperty(value = "创建时间")
    private long created;

    @ApiModelProperty(value = "模型")
    private String model;

    @ApiModelProperty(value = "对象类型")
    private String object;

    @ApiModelProperty(value = "选择列表")
    private List<Choice> choices;

    @ApiModelProperty(value = "使用情况")
    private Usage usage;

    @ApiModelProperty(value = "引用列表")
    private List<String> citations;

    @ApiModelProperty(value = "系统指纹")
    private String system_fingerprint;

    @Data
    @ApiModel(description = "选择")
    public static class Choice {

        @ApiModelProperty(value = "索引")
        private int index;

        @ApiModelProperty(value = "消息")
        private Message message;

        @ApiModelProperty(value = "结束原因")
        private String finish_reason;

        @ApiModelProperty(value = "记录概率")
        private Logprobs logprobs;
    }

    @Data
    @ApiModel(description = "消息")
    public static class Message {

        @ApiModelProperty(value = "角色")
        private String role;

        @ApiModelProperty(value = "内容")
        private String content;

        @ApiModelProperty(value = "推理内容")
        private String reasoning_content;

        @ApiModelProperty(value = "音频")
        private Audio audio;

        @ApiModelProperty(value = "工具调用列表")
        private List<ToolCall> tool_calls;
    }

    @Data
    @ApiModel(description = "音频")
    public static class Audio {

        @ApiModelProperty(value = "ID")
        private String id;

        @ApiModelProperty(value = "数据")
        private String data;

        @ApiModelProperty(value = "过期时间")
        private long expires_at;

        @ApiModelProperty(value = "转录")
        private String transcript;
    }

    @Data
    @ApiModel(description = "工具调用")
    public static class ToolCall {

        @ApiModelProperty(value = "ID")
        private String id;

        @ApiModelProperty(value = "类型")
        private String type;

        @ApiModelProperty(value = "函数调用")
        private FunctionCall function;
    }

    @Data
    @ApiModel(description = "函数调用")
    public static class FunctionCall {

        @ApiModelProperty(value = "名称")
        private String name;

        @ApiModelProperty(value = "参数")
        private String arguments;
    }

    @Data
    @ApiModel(description = "记录概率")
    public static class Logprobs {

        @ApiModelProperty(value = "内容")
        private List<ContentLogprob> content;
    }

    @Data
    @ApiModel(description = "内容记录概率")
    public static class ContentLogprob {

        @ApiModelProperty(value = "令牌")
        private String token;

        @ApiModelProperty(value = "记录概率")
        private int logprob;

        @ApiModelProperty(value = "字节列表")
        private List<Integer> bytes;

        @ApiModelProperty(value = "最高记录概率列表")
        private List<TopLogprob> top_logprobs;
    }

    @Data
    @ApiModel(description = "最高记录概率")
    public static class TopLogprob {

        @ApiModelProperty(value = "令牌")
        private String token;

        @ApiModelProperty(value = "记录概率")
        private int logprob;

        @ApiModelProperty(value = "字节列表")
        private List<Integer> bytes;
    }

    @Data
    @ApiModel(description = "使用情况")
    public static class Usage {

        @ApiModelProperty(value = "提示令牌数")
        private int prompt_tokens;

        @ApiModelProperty(value = "完成令牌数")
        private int completion_tokens;

        @ApiModelProperty(value = "总令牌数")
        private int total_tokens;

        @ApiModelProperty(value = "计费单位")
        private int billed_units;

        @ApiModelProperty(value = "提示令牌详情")
        private TokenDetails prompt_tokens_details;

        @ApiModelProperty(value = "完成令牌详情")
        private TokenDetails completion_tokens_details;
    }

    @Data
    @ApiModel(description = "令牌详情")
    public static class TokenDetails {

        @ApiModelProperty(value = "文本令牌数")
        private int text_tokens;

        @ApiModelProperty(value = "音频令牌数")
        private int audio_tokens;

        @ApiModelProperty(value = "缓存令牌数")
        private int cached_tokens;

        @ApiModelProperty(value = "图像令牌数")
        private int image_tokens;

        @ApiModelProperty(value = "视频令牌数")
        private int video_tokens;

        @ApiModelProperty(value = "引用令牌数")
        private int citation_tokens;

        @ApiModelProperty(value = "推理令牌数")
        private int reasoning_tokens;

        @ApiModelProperty(value = "接受的预测令牌数")
        private int accepted_prediction_tokens;

        @ApiModelProperty(value = "拒绝的预测令牌数")
        private int rejected_prediction_tokens;
    }
}